﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Details.aspx.vb" Inherits="Details" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>


<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">

	<!-- BEGIN content -->
	<div id="content">        
   
            <!-- begin part details -->
            <div class="featuredPart"> 
               
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
               <ContentTemplate>
        
        <div style="float:right">
        
                    <cc1:Rating ID="partRating" runat="server"
                        CurrentRating="2"
                        MaxRating="5"
                        StarCssClass="ratingStar"
                        WaitingStarCssClass="savedRatingStar"
                        FilledStarCssClass="filledRatingStar"
                        EmptyStarCssClass="emptyRatingStar"
                        style="float: left;"  
                   />           
                   <asp:ImageButton ID="imgBtnRate" ImageUrl="~/images/rate.png" 
         runat="server" Width="20px" Height="15px"  /> &nbsp; 

         <asp:ImageButton ID="imgBtnLiking" ImageUrl="~/images/like-icon.png" 
         runat="server" Width="25px" Height="20px"  />
            <asp:Label ID="lblLiking" runat="server" Visible="false" Font-Size="8px" Font-Italic="True"></asp:Label>
        


         </div>               
               </ContentTemplate>
        </asp:UpdatePanel>
      
   
     <asp:FormView ID="FormView1" runat="server"   >
         <ItemTemplate>

             <a href="#">
              <asp:Image ID="bigImg" runat="server" ImageUrl='<%# Bind("BigImageUrl") %>' Width="190px" Height="200px" />
             </a>
		    <h3><a href="#"><%# Eval("Name")%></a>
            </h3>

            <p><%# Eval("Description") %></p>

           <span class="shoppingCartIcon">
             
            <asp:ImageButton ID="imgBtnAddPart" Width="50px" Height="50px" 
              ImageUrl="~/images/shopping-cart.png" runat="server" 
                    onclick="imgBtnAddPart_Click" />
                    
                    </span>  

            </ItemTemplate>
        </asp:FormView>

     	    </div>
		<!-- end part details -->        
         
          <!--  begin recommendation -->
		    <div class="featured">
		
            <h2>customers who bought this item also bought this items </h2>


                <asp:ListView ID="lstVRecommended" runat="server" 
        EnableModelValidation="True" GroupItemCount="4" >
        <GroupTemplate>
            <tr ID="itemPlaceholderContainer" runat="server">
                <td ID="itemPlaceholder" runat="server">
                </td>     
            </tr>
        </GroupTemplate>
        <ItemTemplate>
            <td id="Td1" runat="server" style="color: #000000; padding: 10px 10px 10px 10px; ">
          <asp:HyperLink runat="server" ID= "HyperLink2" Font-Underline="False" Text= '<%# Eval("Name") %>' 
         NavigateUrl='<%# "~/Detail.aspx?PartID=" +Convert.ToString( Eval("PartID")) %>' />
                <br /> 
                <div style="padding-left:10px">
                <asp:HyperLink runat="server" ID= "HyperLink1" Font-Underline="False" 
         NavigateUrl='<%# "~/Details.aspx?PartID=" +Convert.ToString( Eval("PartID")) %>'>
            <asp:Image ID="photoImg" runat="server" ImageUrl='<%# Bind("SmallImageUrl") %>' Width="60px" Height="60px" />
                
                </asp:HyperLink>         
                </div>

            </td>
        </ItemTemplate>
        <LayoutTemplate>
            <table id="Table1" runat="server">
                <tr id="Tr1" runat="server">
                    <td id="Td2" runat="server">
                        <table ID="groupPlaceholderContainer" runat="server" 
                            style=" font-family: Verdana, Arial, Helvetica, sans-serif;">
                              <tr ID="groupPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr id="Tr2" runat="server">
                    <td id="Td3" runat="server" 
                        style="text-align: center;background-color: #CCCCCC;
                        font-family: Verdana, Arial, Helvetica, sans-serif;
                        color: #000000;">
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
    </asp:ListView>





            </div>
		 <!-- end recommendation-->

    </div>
</asp:Content>


<asp:Content ID="Content3" runat="server" contentplaceholderid="SidebarContent">
       
       	<!-- BEGIN sidebar -->
	    <div id="sidebar">
        <div class="box">
		    <h2>Shopping Cart</h2>
             <br />
               <asp:GridView ID="gvwOrderedParts" runat="server" AutoGenerateColumns="False" 
            Width="100%" DataKeyNames="PartID" CellPadding="4" ForeColor="#333333" 
                    GridLines="None" >
                           <AlternatingRowStyle BackColor="White" />
               <Columns>
                
                  <asp:TemplateField HeaderText="Part(s)" HeaderStyle-HorizontalAlign="Left">
                     <ItemTemplate>
                         <asp:Label ID="lblPart" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                     </ItemTemplate>
                      <HeaderStyle HorizontalAlign="Left" />
                  </asp:TemplateField>


                  <asp:TemplateField HeaderText="Price" HeaderStyle-HorizontalAlign="Left">
                     <ItemTemplate>
                        <div style="text-align: Left">
                           <%# FormatPrice(Eval("UnitPrice")) %>
                        </div>
                     </ItemTemplate>
                      <HeaderStyle HorizontalAlign="Left" />
                  </asp:TemplateField>


                  <asp:TemplateField HeaderText="Qty"  HeaderStyle-HorizontalAlign="Left">
                     <ItemTemplate>
                        <div style="text-align: Left;">
                           <asp:TextBox runat="server" ID="txtQuantity" Text='<%# Bind("Quantity") %>' MaxLength="6" Width="30px"></asp:TextBox>
                           <asp:RequiredFieldValidator ID="valRequireQuantity" runat="server" ControlToValidate="txtQuantity" SetFocusOnError="true"
                            ValidationGroup="ShoppingCart"
                              Text="The Quantity field is required." Display="Dynamic"></asp:RequiredFieldValidator>
                           <asp:CompareValidator ID="valQuantityType" runat="server" Operator="DataTypeCheck" Type="Integer"
                              ControlToValidate="txtQuantity" Text="The Quantity must be an integer."
                              ToolTip="The Quantity must be an integer." Display="dynamic" />
                        </div>
                     </ItemTemplate>
                     <ItemStyle Width="60px" />
                  </asp:TemplateField> 

                   <asp:TemplateField ItemStyle-HorizontalAlign="Center" >
                     <ItemTemplate >
                         <asp:ImageButton ID="btnRemoveFromCart" ImageUrl="~/images/delete-icon.png" CausesValidation="False"
                             CommandName="Delete" runat="server" AlternateText="Delete" />

                     </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
                     </asp:TemplateField> 
               </Columns>
              
               <EmptyDataTemplate><b>You have no part in your basket yet</b></EmptyDataTemplate>   
                           <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                           <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                           <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                           <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                           <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                           <SortedAscendingCellStyle BackColor="#FDF5AC" />
                           <SortedAscendingHeaderStyle BackColor="#4D0000" />
                           <SortedDescendingCellStyle BackColor="#FCF6C0" />
                           <SortedDescendingHeaderStyle BackColor="#820000" />
            </asp:GridView>
		    
            <br />

               <asp:Panel runat="server" ID="panTotals">
            <div style="text-align: right; font-weight: bold; padding-top: 4px;">
             <p>  Subtotal: <asp:Literal runat="server" ID="lblSubtotal" />  </p> 
             
               <br />

               <p>
               Shipping Method: 
               <asp:DropDownList ID="ddlShippingMethods" runat="server" AutoPostBack="true" >
                  <asp:ListItem Value="5.00 £">Standard (5.00 £)</asp:ListItem> 
                  <asp:ListItem Value="10.00 £">Next Business day (10.00 £)</asp:ListItem>  
                  <asp:ListItem Value="15.00 £">Overnight (15.00 £)</asp:ListItem>  

               </asp:DropDownList>
               </p>
               <br />
              
               <p>
                     <asp:Button ID="btnUpdateTotals" runat="server"  Text="Update totals" /> &nbsp; &nbsp;
               <u>Total:</u> <asp:Literal runat="server" ID="lblTotal" />
               </p>
                <br />
                
              <small>   
                 <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/Default.aspx"> << Continue shopping</asp:HyperLink>
                 &nbsp; &nbsp;
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/CheckOut.aspx">Proceed with order >></asp:HyperLink>
              
               </small>              
               <br />
                <br />
            </div>
            </asp:Panel>
           
            </div>
       
        <div class="box" >
        <h2>Close Items</h2>
           
           <div style="padding-left:5px; overflow:auto;">
                 <asp:Panel ID="pnlCloseItems" runat="server" >
           </asp:Panel>      
           </div>
        </div>

         <div class="box">
        <h2>Strong Rules (measure of certainty)</h2>
         <div style="padding-left:5px; overflow:auto;">
            <asp:Panel ID="pnlStronRules" runat="server" >
            </asp:Panel>
         </div>
        </div>

        </div>
	<!-- END sidebar -->
       </asp:Content>




